$(document).ready(function() {
    detail();
});
function detail() {
    var projectId = getQueryString("projectId");
    $.ajax({
        url: "http://localhost:8080/finishProject/queryProjectById?projectId=" + projectId,
        type: "GET",
        async: false,
        dataType: "json",
        success: function (data) {
           //data.project
            var projectName=data.data.project.projectName;
            var projectPlatform=data.data.project.projectPlatform;
            var projectContactPeople=data.data.project.projectContactPeople;
            var projectPhonenum=data.data.project.projectPhonenum;
            var projectStartDate=data.data.project.projectStartDate;
            var projectEndtDate=data.data.project.projectEndtDate;
            var stuNum=data.data.project.stuNum;
            var stuName=data.data.project.stuName;
            var termYear=data.data.project.termYear;
            var termNum=data.data.project.termNum;
            var projectConclusion=data.data.project.projectConclusion;

            $("input[name='stuNum']").val(stuNum);
            $("input[name='stuName']").val(stuName);
            $("input[name='termYear']").val(termYear);
            $("input[name='termNum']").val(termNum);
            $("input[name='projectName']").val(projectName);
            $("input[name='projectPlatform']").val(projectPlatform);
            $("input[name='projectContact']").val(projectContactPeople);
            $("input[name='projectPhonenum']").val(projectPhonenum);
            $("input[name='projectStartDate']").val(projectStartDate);
            $("input[name='projectEndtDate']").val(projectEndtDate);
            $("textarea[name='projectConclusion']").val(projectConclusion);
        },
        error: function () {
            layer.alert("暂无记录")
        }
    })
}

$(document).on('click', '#before', function () {
    location.href="finishProjectManger.html";
})

//获取addMark.html的url地址参数
function getQueryString(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
        //return unescape(r[2]);
        //decodeURI解码
        return decodeURI(decodeURI(r[2]));
    }
    return null;
}